package com.comtop.springboot.templet.modules.app.controller;


import com.comtop.springboot.templet.common.utils.Ret;
import com.comtop.springboot.templet.common.validator.Assert;
import com.comtop.springboot.templet.modules.app.service.IUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 注册
 * @author wangjiafang
 * @version 1.0
 * @since 2017-03-26 17:27
 */
@RestController
@RequestMapping("/app")
public class ApiRegisterController {
    @Autowired
    private IUserService IUserService;

    /**
     * 注册
     */
    @PostMapping("/register")
    public Ret register(String mobile, String password){
        Assert.isBlank(mobile, "手机号不能为空");
        Assert.isBlank(password, "密码不能为空");

        IUserService.save(mobile, password);

        return Ret.ok();
    }
}
